/*
 * 11.3.cpp
 *
 *  Created on: 2012-5-25
 *      Author: jawinton
 */


#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

struct Student{
	char ID[20];
	char name[50];
	float score;
	Student *next, *pre;
};

struct StudentList{
	Student *head, *tail;
	int totalStudent;
	float totalScore;
};

StudentList list;

bool addStudent(Student *stu) {
	if (list.tail == NULL) {
		list.head = list.tail = stu;
		stu->next = NULL;
		stu->pre = NULL;
	} else {
		Student *node = list.head;
		while (node != NULL && strcmp(node->ID, stu->ID) < 0) node = node->next;
		if (node == NULL) {
			stu->pre = list.tail;
			stu->next = NULL;
			list.tail->next = stu;
			list.tail = stu;
		} else if (node == list.head){
			stu->next = node;
			stu->pre = NULL;
			node->pre = stu;
			list.head = stu;
		} else {
			stu->pre = node->next;
			stu->next = node;
			node->pre->next = stu;
			node->pre = stu;
		}
	}
	list.totalStudent++;
	list.totalScore += stu->score;
	return true;
}

bool delAllStudent() {
	while (list.head != NULL) {
		Student *stu = list.head;
		list.head = list.head->next;
		delete stu;
	}
	return true;
}

int main (void) {
	list.head = NULL;
	list.tail = NULL;
	list.totalScore = 0;
	list.totalStudent = 0;
	Student *stu;
	while (true) {
		stu = new Student;
		scanf("%s%s%f", stu->ID, stu->name, &stu->score);
		if (stu->score < 0) {
			delete stu;
			break;
		}
		stu->pre = stu->next = NULL;
		addStudent(stu);
	}
	printf("Total students: %d, total score: %.2f\n", list.totalStudent, list.totalScore);
	stu = list.head;
	while (stu != NULL) {
		printf("%s %s %.2f\n", stu->ID, stu->name, stu->score);
		stu = stu->next;
	}
	delAllStudent();
	return 0;
}
